<?php if(!IS_AJAX){  ?>
<include file="Public:header" />
<section class="panel">
	<header class="panel-heading">
		个人积分趋势图    
        <div class="btn-group pull-right">
            <form id="lineChartform" action="{:U('')}">
            	<?php if($inteType){ ?>
                <div class="btn-group dropdown" data-position="bottom" data-intro="这里输入积分">
                    <button class="form-control dropdown-toggle intebtn input-none"  type="button" id="intebtn" data-toggle="dropdown">积分类型 <span class="caret"></span></button>
                    <ul class="dropdown-menu menu-show" id="inteList">
                        <volist name="inteType" id="vo">
                            <?php if($i>1){ ?>
                                <li class="divider"></li>
                            <?php } ?>
                            <li class="icheck">
                                <div class="minimal-red single-row">
                                    <div class="radio">
                                        <input type="radio"  name="integralType" value="{$vo.typename}">
                                        <label>{$vo.remark}</label>
                                    </div>
                                </div>
                            </li>
                        </volist>
                    </ul>
                </div>
                <?php  } ?>
                <input type="hidden" name="chartType" class="chartType" value="week"/>
                <button class="btn btn-default btn-chart" type="submit" form="lineChartform" value="year" name="chartType">年</button>
                <button class="btn btn-default btn-chart" type="submit" form="lineChartform" value="month" name="chartType">月</button>
                <button class="btn btn-default btn-chart" type="submit" form="lineChartform" value="week" name="chartType">周</button>
            </form>
        </div>
        <div class="clearfix"></div>
    </header>
    <div class="panel-body">
        <div class="chartJS" >
        	<div class="pull-right">
                <div class="btn-group">        
                    <div class="btn btn-warning">
                        <i class="fa icon-thumbs-up"></i>
                        奖扣次数 
                        <span class="numCount">
                        {:abs($numCount[1]).'/'.$numCount[0];}  ({:abs(number_format($numCount[1]/$numCount[0],2))*100}%)
                        </span>
                    </div>
                </div>
                <div class="btn-group">        
                    <div class="btn btn-warning">
                        <i class="fa icon-thumbs-up"></i>
                        奖扣分数 
                        <span class="numSum">
                        {:abs($numSum[1]).'/'.$numSum[0];}  ({:abs(number_format($numSum[1]/$numSum[0],2))*100}%)
                        </span>
                    </div>
                </div>
            </div>
            <canvas  height="250" width="1400" id="line-Chart"></canvas>
			<div id="lineChart">
<?php } ?>	
			<div><div></div></div>
            
			<script>
            $(document).ready(function(){
                var Linedata = {
                    labels : ['{:implode("','",$chartDate)}'],
                    datasets : [
                        <?php  foreach($chartArr as $k=>$v){   $color=['#65CEA7','#FC8675'];  ?>
                        {
                            fillColor 		 : "{$color[$k]}",
                            pointColor  	 : "{$color[$k]}",
                            strokeColor 	 : "{$color[$k]}",
                            pointStrokeColor : "#fff",
							label: "My Second dataset",
							pointHighlightFill: "#fff",
							pointHighlightStroke: "rgba(151,187,205,1)",
                            data 			 : [{:implode(',',$v)}]
                        },
                        <?php } ?>

                    ]
                }
				var numCount='{:abs($numCount[1]).'/'.$numCount[0];}  ({:abs(number_format($numCount[1]/$numCount[0],2))*100}%)';
				var numSum='{:abs($numSum[1]).'/'.$numSum[0];}  ({:abs(number_format($numSum[1]/$numSum[0],2))*100}%)';   
				//'
				$('.numCount').text(numCount);
				$('.numSum').text(numSum);
				var cxt=document.getElementById("line-Chart").getContext("2d");
                var myLineChart = new Chart(cxt).Line(Linedata,{showTooltips: true});
            });
            </script>
<?php if(!IS_AJAX){ ?>
                
            </div>
        </div>
    </div>
</section>
<include file="Public:script" />
<script src="__PUBLIC__/Intesys/AdminX/js/morris-chart/raphael-min.js"></script>
<script src="__PUBLIC__/Intesys/AdminX/js/chart-js/Chart.js"></script>
<script>
	$("#lineChart").ajaxlist({success:function(data){
		console.log(data);	
	}});
	$(".btn-chart").click(function(e) {
        $('#lineChartform').find('.chartType').val($(this).val())
    });
        
</script>
</body></html>
<?php } ?>